from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from time import sleep

url = 'https://www.baidu.com'
chrome_location = r'D:\chrom browser\chrome-win\chrome.exe'
options = webdriver.ChromeOptions()
options.binary_location = chrome_location
dr = webdriver.Chrome(options=options)
dr.get(url)
sleep(1)
dr.get(r'https://news.baidu.com/')
sleep(1)
# dr.minimize_window()
# sleep(2)
# dr.maximize_window()
# sleep(2)
# dr.set_window_size(400, 600)
# sleep(2)
# print(dr.get_window_size())
dr.back()
sleep(1)
dr.forward()
sleep(1)
dr.refresh()
sleep(1)
dr.quit()